<template>
  <div>
    <h2>我是home的内容</h2>
    <ul class="nav nav-tabs">
      <li>
<!--        注意:这里的路径要写全 -->
        <router-link class="list-group-item" active-class="active" to="/home/news">News</router-link>
      </li>
      <li>
        <router-link class="list-group-item " active-class="active" to="/home/message">Message</router-link>
      </li>
    </ul>
<!--    缓存组件 不销毁组件 include包含的是 组件名！！！！ 如果不写include 就包含全部的路由组件 要包含多个组件用括号[] include前面加: -->
    <keep-alive include="my-news">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
export default {
  name: "my-home",
  //不用的组件会被销毁
  // mounted() {
  //   console.log('home挂载');
  // },
  // beforeDestroy() {
  //   console.log('home销毁');
  // }
}
</script>

<style scoped>

</style>